% construct diffusion and random force part
function rest = randomOU(t,y,para)

load('betas');
load('msval');

a=para(1); m=para(2); b=para(3);num=para(4);

row=size(betas,1); colum=size(betas,2);
if row >=2
    rest(row)=0;
end
dt1=0.5/num; 
t2courseindex=floor((t+0.5*dt1)/dt1)+1;
rest(1)=a*m-a*y(1);

rest(2:row)=-a*y(2:row)'+b*msval(t2courseindex,1:colum);

rest=rest';




